<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/css/x-admin.css" media="all">
    <link rel="stylesheet" href="/static/layer/skin/default/layer.css" media="all">

</head>
<body>
<div class="x-body">
    <form class="layui-form x-center" action="" style="width:555px">
        <div class="layui-form-pane" style="margin-top: 15px;">
            <div class="layui-form-item">

                <h3>产品类型</h3>

                <div class="layui-form-item layui-form-text" style="width: 555px">

                    <label class="layui-form-label">产品类型：</label>

                    <div class="layui-input-block">
                        <textarea id="kindName" placeholder="请输入产品类型" class="layui-textarea"></textarea>
                    </div>


                    <div class="layui-form-mid layui-word-aux" style="color: red">多类型请用逗号隔开</div>

                </div>


                <div class="layui-input-inline" style="width:555px">
                    <button  id="addprokind" class="layui-btn layui-btn-normal"
                    " lay-submit=""><i class="layui-icon">新增</i>
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>









</body>
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script src="/static/js/x-layui.js" charset="utf-8"></script>
<script src="/static/js/jquery-1.8.3.js" charset="utf-8"></script>
<script src="/static/layer/layer.js" charset="utf-8"></script>


<script>
    layui.use(['laydate', 'element', 'laypage', 'layer'], function () {
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层

        //以上模块根据需要引入


        laypage({
            cont: 'page'
            , pages: 100
            , first: 1
            , last: 100
            , prev: '<em><</em>'
            , next: '<em>></em>'
        });


        var start = {
            min: laydate.now()
            , max: '2099-06-16 23:59:59'
            , istoday: false
            , choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min: laydate.now()
            , max: '2099-06-16 23:59:59'
            , istoday: false
            , choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };

        document.getElementById('LAY_demorange_s').onclick = function () {
            start.elem = this;
            laydate(start);
        }
        document.getElementById('LAY_demorange_e').onclick = function () {
            end.elem = this
            laydate(end);
        }



    });

$(function () {
    $("#addprokind").click(function () {
        alert($("#kindName").val());
        $.post( "/promsg/insertKind",{

            name: $("#kindName").val(),

        }, function (data) {
            if (data != null) {
                alert($("#kindName").val());
                layer.msg('新增成功',
                        {
                            offset: ['100px', '850px']
                        })
            } else {
                layer.msg('新增失败',
                        {
                            offset: ['100px', '850px']
                        }
                );
            }
        })
    })
})




</script>
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();

</script>

</html>